package org.jeecg.modules.monitoring.j_monitoring.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.monitoring.j_monitoring.entity.EquipmentData;
import org.jeecg.modules.monitoring.j_monitoring.entity.EquipmentItem;
import org.jeecg.modules.monitoring.j_monitoring.entity.MCabinet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.monitoring.j_monitoring.vo.MCabinetDevice;

/**
 * @Description: 机柜
 * @Author: xiaoyq
 * @Date:   2023-02-22
 * @Version: V1.0
 */
public interface MCabinetMapper extends BaseMapper<MCabinet> {

    /**
     * 机柜分页查询
     * @param pagelist
     * @param queryWrapper
     * @return
     */
    Page<MCabinet> getPageList(Page<MCabinet> pagelist, @Param("ew") QueryWrapper queryWrapper);

    /**
     * 根据机柜编号获得所有设备列表
     * @param id
     * @return
     */
    List<EquipmentItem> getEquipmentAllList(@Param("id") String id);

    /**
     * 根据名称获得机柜列表
     * @param name
     * @return
     */
    List<MCabinet> selectByName(@Param("name") String name);

    /**
     * 根据机柜id获得设备列表
     * @param idList
     * @return
     */
    List<MCabinetDevice> getDeviceListByIds(@Param("idList")List<String> idList);

    /**
     * 获得所有机柜列表
     * @return
     */
    List<MCabinet> selectAll();

    /**
     * 获得机房机柜数量
     * @param room
     * @return
     */
    Integer selectCabinetCountByRoom(@Param("room")String room);

    /**
     * 获得机房空调数量
     * @param room
     * @return
     */
    Integer selectAirCountByRoom(@Param("room")String room);
}
